﻿var {Response} = require('ringo/webapp/response');
var {Request} = require('ringo/webapp/request');
//require("ringo/engine").setOptimizationLevel(9);
var {lang} = require("./lang/lang");

var db = require("./model");
    
export('index');

function index(req) {
	lang.addLang();
    var skin = (req.session.data.ua == "BB") ? "skins/index_mobil.html" : "skins/index.html" ;
    req.session.data.user = db.getUser(req.session.data.user.account);
    req.session.data.menu = req.session.data.user.getMenu(req.session.data.host.sap,req.session.data.language);
    return Response.skin(module.resolve(skin), {
        session   : req.session.data,
        pageTitle : lang.islemsec,
    });
};
